package com.audaque.springboot.foshanupload.web.nosaveframeworklogin.config;


import com.audaque.springboot.foshanupload.authcore.properties.LoginProperties;
import com.audaque.springboot.foshanupload.core.properties.StaticResourcePathProperties;
import com.audaque.springboot.foshanupload.web.nosaveframeworklogin.interceptor.LoginResponseInterceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;
import java.util.List;

/**
 * @author zgb
 * @desc Interceptor用于鉴证和鉴权
 * @date 2022-01-25 22:24:15
 */
@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private LoginResponseInterceptor loginResponseInterceptor;

    @Autowired
    private StaticResourcePathProperties staticResourcePathProperties;


    @Autowired
    private LoginProperties loginProperties;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(loginResponseInterceptor).addPathPatterns(loginProperties.getLoginUrl()).order(100);



    }


}
